<?php
class Subscriber extends Controller
{
    function __construct()
    {
        parent::__construct();
        
        $this->load->library('session');
        
		 if($this->session->userdata('admin') == '')
		 {    
		     redirect('admin');
		 }
         
        $this->load->model('subscriber_model');
        
    }
    
    function index()
    {   
        $data['query'] = $this->subscriber_model->getAllResults();
        
        
        $this->load->view(TEMPLATE_NAME.'/admin/subscriber_view',$data);
    }
    
    function delete($first)
    {
        $this->subscriber_model->delete_subscriber($first);
        
        redirect('admin/subscriber');
    }
    
    function export_excel()
    {
        $this->subscriber_model->exporttoexcel();
    }
}
?>